import http from '@/server'

export async function getGroupList(params: Group.GroupListParams) {
    return http.request({
      url: '/group/get_groups',
      method: 'post',
      headers: {
        'Content-Type': 'application/json', // 设置为 application/json
      },
      data: params, // 使用 data 代替 params，将参数作为请求体传递
    });
}

export async function addGroup(params: Group.GroupEntity) {
    return http.request({
      url: '/group/create_group',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function getGroupMember(params: Group.GroupEntity) {
    return http.request({
      url: '/group/get_group_member_list',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function setGroup(params: Group.GroupEntity) {
    return http.request({
      url: '/group/set_group_info',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function muteGroup(params: Group.GroupEntity) {
    return http.request({
      url: '/group/mute_group',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function cancelMuteGroup(params: Group.GroupEntity) {
    return http.request({
      url: '/group/cancel_mute_group',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function dismissGroup(params: Group.GroupEntity) {
    return http.request({
      url: '/group/dismiss_group',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function muteGroupMember(params: Group.GroupEntity) {
    return http.request({
      url: '/group/mute_group_member',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function cancelMuteGroupMember(params: Group.GroupEntity) {
    return http.request({
      url: '/group/cancel_mute_group_member',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

export async function kickGroupMember(params: Group.GroupEntity) {
    return http.request({
      url: '/group/kick_group',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
      },
      data: params,
    });
}

